/*!
 * 
 * 选择变电站
 * 
 */
Ext.onReady(function(){

    Ext.QuickTips.init();

    var xg = Ext.grid;
   
    var store = new Ext.data.GroupingStore({
    		proxy:new Ext.data.HttpProxy({
    			url:'bdz!getBdzList.do'
    		}),
            reader:new Ext.data.JsonReader({
				root :'result',
				totalProperty :'totalCount',
				fields:['id','bdzcode', 'bdzname','dydjname','remark','dydj','sortid']
			}),
            sortInfo:{field: 'dydj', direction: "ASC"},
            groupField:'dydjname'
        });
    
    store.load();

    var grid = new xg.GridPanel({
    	id:"select_bdz_grid",
        store: store,
        columns: [
            new Ext.grid.RowNumberer(),
            {header: "变电站编号", width: 50, sortable: true,dataIndex: 'bdzcode'},
            {header: "变电站名称", width: 50, sortable: true, dataIndex: 'bdzname'},
            {header: "电压等级", width: 50, sortable: true, dataIndex: 'dydjname'},
        ],

        view: new Ext.grid.GroupingView({
            forceFit:true,
            groupTextTpl: '{text} ({[values.rs.length]} {[values.rs.length > 1 ? "条" : "条"]})'
        }),
        buttons: [{text:'确定',
        	      handler: function(){
            		
                 }
                 },{text:'取消'}],
        buttonAlign:'center',
        frame:true,
        width: 450,
        height: 450,
        collapsible: true,
        animCollapse: false,
        title: '选择变电站',
        iconCls: 'icon-grid',
        renderTo: document.body
    });
});